<?php
/**
 * Truncate a block of text to a number of chars. This is a very un-smart helper.
 * It doesn't take HTML or anything like that into account.
 *
 * @package     Visi
 * @subpackage  View Helpers
 * @author      Luke Visinoni <luke.visinoni@gmail.com>
 * @copyright   (c) 2011 Coalition Technologies <joel@coalitiontechnologies.com>
 * @version     $Id$
 */
class Visi_View_Helper_TruncateChars extends Zend_View_Helper_Abstract {

    public function truncateChars($text, $num, $after = '') {
    
        $ret = substr($text, 0, $num);
        if (strlen($text) > $num) $ret .= $after;
        return $ret;
    
    }

}
